package com.ikas.ai.server.module.morningpaper.model.elements.condition.u02;

import com.ikas.ai.server.module.data.model.tdengine.RealDataHis;
import com.ikas.ai.server.module.morningpaper.consts.MorningPaperElementPriorities;
import com.ikas.ai.server.module.morningpaper.consts.MorningPaperNormalVariableNames;
import com.ikas.ai.server.module.morningpaper.model.dto.MorningPaperVariablesDto;
import com.ikas.ai.server.module.morningpaper.model.elements.condition.AbstractElementMachineConditionCost;
import com.ikas.ai.server.module.morningpaper.model.po.MorningPaperVariablesPo;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Lazy

public class ElementMachineU02ConditionGPowerUpHours extends AbstractElementMachineConditionCost {

    protected String MORNING_PAPER_VARIABLE_NAME = MorningPaperNormalVariableNames.machineU02ConditionGPowerUpHours.name();
    @Override
    public String getMorningPaperVariableName() {
        return MORNING_PAPER_VARIABLE_NAME;
    }
    protected MorningPaperElementPriorities PRIORITY = MorningPaperElementPriorities.SECOND_PRIORITY;
    @Override
    public MorningPaperElementPriorities getPriority(){
        return PRIORITY;
    }

    @Override
    public MorningPaperVariablesDto render(MorningPaperVariablesDto mv, Map<String, MorningPaperVariablesPo> variablesPoMap, Map<String, Object> transmitMap) {
        super.render(mv, variablesPoMap, transmitMap);
        List<RealDataHis> realDataHis = (List<RealDataHis>) transmitMap.get(MorningPaperNormalVariableNames.machineU02ConditionGPowerUpCount.name());
        mv.setMachineU02ConditionGPowerUpHours(fillConditionHours(this,realDataHis ));
        transmitMap.remove(MorningPaperNormalVariableNames.machineU02ConditionGPowerUpCount.name());
        return mv;
    }
}
